package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.StoreGrouponPackagesMapper;
import com.ruoyi.system.domain.StoreGrouponPackages;
import com.ruoyi.system.service.IStoreGrouponPackagesService;

/**
 * 门店团购套餐Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-14
 */
@Service
public class StoreGrouponPackagesServiceImpl implements IStoreGrouponPackagesService
{
    @Autowired
    private StoreGrouponPackagesMapper storeGrouponPackagesMapper;

    /**
     * 通过id查询门店团购套餐
     *
     * @param id 门店团购套餐主键
     * @return 门店团购套餐
     */
    @Override
    public StoreGrouponPackages selectStoreGrouponPackagesById(Long id)
    {
        return storeGrouponPackagesMapper.selectStoreGrouponPackagesById(id);
    }

    /**
     * 查询门店团购套餐列表
     *
     * @param packageName,status 套餐名称，状态
     * @return 门店团购套餐
     */
    @Override
    public List<StoreGrouponPackages> selectStoreGrouponPackagesList(String packageName,String status)
    {
        return storeGrouponPackagesMapper.selectStoreGrouponPackagesList(packageName,status);
    }

    /**
     * 新增门店团购套餐列表
     *
     * @param storeGrouponPackages 门店团购套餐
     * @return 结果
     */
    @Override
    public int insertStoreGrouponPackages(StoreGrouponPackages storeGrouponPackages)
    {
        storeGrouponPackages.setCreateTime(DateUtils.getNowDate());
        return storeGrouponPackagesMapper.insertStoreGrouponPackages(storeGrouponPackages);
    }

    /**
     * 修改门店团购套餐列表
     *
     * @param storeGrouponPackages 门店团购套餐
     * @return 结果
     */
    @Override
    public int updateStoreGrouponPackages(StoreGrouponPackages storeGrouponPackages)
    {
        storeGrouponPackages.setUpdateTime(DateUtils.getNowDate());
        return storeGrouponPackagesMapper.updateStoreGrouponPackages(storeGrouponPackages);
    }

    /**
     * 批量删除门店团购套餐列表
     *
     * @param ids 需要删除的门店团购套餐主键
     * @return 结果
     */
    @Override
    public int deleteStoreGrouponPackagesByIds(Long[] ids)
    {
        return storeGrouponPackagesMapper.deleteStoreGrouponPackagesByIds(ids);
    }

    /**
     * 删除门店团购套餐信息列表
     *
     * @param id 门店团购套餐主键
     * @return 结果
     */
    @Override
    public int deleteStoreGrouponPackagesById(Long id)
    {
        return storeGrouponPackagesMapper.deleteStoreGrouponPackagesById(id);
    }
}
